<!DOCTYPE HTML>
<html>
<head>
	<script type="text/javascript">
        function draw(){
        	var id = document.getElementById("myLove");
        	var cxt = id.getContext("2d");
        	cxt.fillStyle = "#eeeeef";
        	cxt.fillRect(0, 0, 500, 500);  //填充背景色  可以不要
        	cxt.translate(300,50);
        	cxt.fillStyle = "rgba(255,0,0,0.25)";
        	for (var i = 0; i < 500; i++) {
        		cxt.fillRect(0,0,80,30);  
                cxt.translate(20,20);  
                cxt.scale(0.99,0.99);  
                cxt.rotate(Math.PI/20);  
        	};
        }

	</script>
</head>
<body onload="draw()">
	<canvas id="myLove" width="500" height="500" style="margin:300px 500px;"></canvas>
</body>
</html>